package com.tnstudio.Internet_Speedup_One_Click;

import java.text.DecimalFormat;

public class Common {
	final static String[] list = {"full network access","view network connections"};
	final static Boolean CheckPermission(String str)
	{
		Boolean status=false;
		if(str.equalsIgnoreCase("full network access") || str.equalsIgnoreCase("view network connections"))
			status = true;		
		return status;
	}
	final static String GetSizeFile(double num)
	{
		double temp;
		temp = num/1024;
		 DecimalFormat precision = new DecimalFormat("0.00");
		if((num/1024)<= 1)
		{
			return precision.format(num)+ " K";
		}
		else
		{
			if((num/1024/1024)<= 1)
			{
				return precision.format(num/1024)+ " KB";
			}
			else
			{
				int i = (int) (num/1024/1024);
				long sub = (long) (num/1024 - i*1024);
				return precision.format(i+"."+sub)+ " MB";
				
			}
			
		}
			
	}
}
